<template>
	<view>
		<view class="detailedBox">
			<view class="detailedBoxItem">
				<view>
					<view>订单号</view>
					<view>{{operationRecordList.order.orderCode}}</view>
				</view>
				<view>
					<view>顾客编号</view>
					<view>{{operationRecordList.order.orderTypeDesc=='注册订单'?operationRecordList.payOrderMember.memberCode:operationRecordList.orderMember.memberCode}}</view>
				</view>
				<view>
					<view>姓名</view>
					<view>{{operationRecordList.order.orderTypeDesc=='注册订单'?operationRecordList.payOrderMember.realName:operationRecordList.orderMember.realName}}</view>
				</view>
				<view>
					<view>订单类型</view>
					<view>{{operationRecordList.order.orderTypeDesc}}</view>
				</view>
				<view>
					<view>日期</view>
					<view>{{operationRecordList.order.creatTime}}</view>
				</view>
				<view>
					<view>订单金额</view>
					<view>¥{{operationRecordList.order.goodsAmount ||0}}</view>
				</view>
			</view>		
		</view>
		<view class="detailedBox">
				<view class="detailedBoxItem">
					<view>
						<view>产品编号</view>
						<view>{{operationRecordList.ordersDetailMap[0].PACKAGE_CODE}}</view>
					</view>
					<view>
						<view>产品名称</view>
						<view>{{operationRecordList.ordersDetailMap[0].PACKAGE_NAME}}</view>
					</view>
					<view>
						<view>价格</view>
						<view>{{operationRecordList.ordersDetailMap[0].PRICE}}</view>
					</view>
					<view>
						<view>商品数量</view>
						<view>{{operationRecordList.ordersDetailMap[0].COUNTS}}</view>
					</view>
					<view>
						<view>金额</view>
						<view>{{operationRecordList.ordersDetailMap[0].AMOUNT}}</view>
					</view>
					<view>
						<view>备注</view>
						<view>{{operationRecordList.ordersDetailMap[0].MEMO || ""}}</view>
					</view>
				</view>		
			</view>
		<view class="closeButton" @click="closeButtonFunc">
			关闭
		</view>
	</view>
</template>

<script>
	import {
		getOrderInfo
	} from '@/api/directSelling.js';
	export default {
		data() {
			return {
				operationRecordList:{
					order:{},
					orderMember:{},
					ordersDetailMap:[],
					payOrderMember:{}
				},
				orderId:""
			}
		},
		onLoad(options) {
			this.orderId=options.orderId;
		},
		created() {
			this.getTransferInquire()
		},
		methods: {
			getTransferInquire(){
				getOrderInfo({
					orderId:this.orderId
				}).then((res)=>{
					let data=res.data;
					this.operationRecordList=data;
					this.operationRecordList.ordersDetailMap=data.ordersDetailMap;
				}).catch((err)=>{
					
				})
			},
			closeButtonFunc(){
				uni.switchTab({
					url: "/pages/user/memberCenter",
					animationType: 'none',
					animationDuration: 0,
					fail(err) {
						uni.redirectTo({
							url: "/pages/user/memberCenter",
							animationType: 'none',
							animationDuration: 0
						})
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	body,
	page {
		background: #fff;
		padding: 20rpx 30rpx;
		box-sizing: border-box;
	}

	.detailedBox {
		width: 100%;
		height: auto;
		padding: 20rpx 30rpx;
		box-sizing: border-box;
		box-shadow: 0px 0px 10px #e6e6e6;
		border-radius: 21rpx;
		margin-bottom:40rpx;
		.detailedTotal {
			text-align: center;

			.amount {
				font-size: 56rpx;
				font-weight: bold;
				margin-top: 25rpx;
				margin-bottom: 20rpx;
			}
		}

		>view.detailedBoxItem>view {
			display: flex;
			justify-content: space-between;
			line-height: 45rpx;
			font-size: 28rpx;
			margin-top: 25rpx;
			>view:nth-child(2){
				font-size:26rpx;
			}
		}
	}
	.keepBnt {
		width: 690rpx;
		height: 86rpx;
		border-radius: 50rpx;
		text-align: center;
		line-height: 86rpx;
		margin: 50rpx auto;
		font-size: 32rpx;
		color: #fff;
	}
	.closeButton{
		width:700rpx;
		height:86rpx;
		border-radius: 50rpx;
		text-align:center;
		line-height:89rpx;
		margin:50rpx auto;
		font-size:32rpx;
		color:#fff;
		background:$theme-color;
	}
</style>
